var fs = require('fs')

function logfn(obj,num){
    num=num||Date.now();
    var url = './log-'+num+'.js';
    fs.writeFile(url, JSON.stringify(obj, null, '\t'), function (error) {
        if (error) {
        console.log('写入失败');
        } else {
        console.log('写入成功');
        }
    })

}

exports.logfn = logfn;